﻿#region using
using System.Collections.Generic;
using Microsoft.Xna.Framework;
#endregion

namespace AwesomeTanks.Sources.GameElements.Factories
{
    /// <summary>
    /// The factory of Type of Games. This class returns a list of Teams with players
    /// </summary>
    public static class TeamFactory
    {
        /// <summary>
        /// Gets teams for 1vs1 game.
        /// </summary>
        /// <returns></returns>
        public static List<Team> GetTeamsFor1vs1Game()
        {
            List<Team> listTeams = new List<Team>();
            Team team1 = new Team("teamBlue",TeamColor.BLUE);
            Team team2 = new Team("teamRed",TeamColor.RED);

            team1.AddPlayer(PlayerFactory.CreatePlayer("Player1", team1.TeamColor,PlayerIndex.One));
            team2.AddPlayer(PlayerFactory.CreatePlayer("Player2", team2.TeamColor, PlayerIndex.Two));

            listTeams.Add(team1);
            listTeams.Add(team2);

            return listTeams;
        }

        /// <summary>
        /// Gets the teams for 2vs2 game.
        /// </summary>
        /// <returns></returns>
        public static List<Team> GetTeamsFor2vs2Game()
        {
            List<Team> listTeams = new List<Team>();
            Team team1 = new Team("teamBlue", TeamColor.BLUE);
            Team team2 = new Team("teamRed", TeamColor.RED);

            team1.AddPlayer(PlayerFactory.CreatePlayer("Player1", team1.TeamColor,PlayerIndex.One));
            team2.AddPlayer(PlayerFactory.CreatePlayer("Player2", team2.TeamColor, PlayerIndex.Two));
            team1.AddPlayer(PlayerFactory.CreatePlayer("Player3", team1.TeamColor, PlayerIndex.Three));
            team2.AddPlayer(PlayerFactory.CreatePlayer("Player4", team2.TeamColor, PlayerIndex.Four));

            listTeams.Add(team1);
            listTeams.Add(team2);

            return listTeams;
        }

        /// <summary>
        /// Gets the teams for a 3 Players FFA.
        /// </summary>
        /// <returns></returns>
        public static List<Team> GetTeamsForFFAGameOf3()
        {
            List<Team> listTeams = new List<Team>();
            Team team1 = new Team("teamBlue", TeamColor.BLUE);
            Team team2 = new Team("teamRed", TeamColor.RED);
            Team team3 = new Team("teamGreen", TeamColor.GREEN);

            team1.AddPlayer(PlayerFactory.CreatePlayer("Player1", team1.TeamColor, PlayerIndex.One));
            team2.AddPlayer(PlayerFactory.CreatePlayer("Player2", team2.TeamColor, PlayerIndex.Two));
            team3.AddPlayer(PlayerFactory.CreatePlayer("Player3", team3.TeamColor, PlayerIndex.Three));

            listTeams.Add(team1);
            listTeams.Add(team2);
            listTeams.Add(team3);
            
            return listTeams;
        }

        /// <summary>
        /// Gets the teams for a 4 Players FFA.
        /// </summary>
        /// <returns></returns>
        public static List<Team> GetTeamsForFFAGameOf4()
        {
            List<Team> listTeams = GetTeamsForFFAGameOf3();

            Team team4 = new Team("teamYellow", TeamColor.YELLOW);
            team4.AddPlayer(PlayerFactory.CreatePlayer("Player4", team4.TeamColor, PlayerIndex.Four));
            listTeams.Add(team4);

            return listTeams;
        }        
    }
}
